package com.prs.crm.domain.fs;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.FlowEntity;

@Entity
@Table(name="fs_outlayapply")
public class OutlayApply extends FlowEntity{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	private String title;
	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	private String state;
	@Lob
	private String summary;
	private Double money;
	private String isReturn;
	private String returnFlag;
	private String level;
	@OneToMany(fetch = FetchType.LAZY,mappedBy="apply")
	private Set<ApplyDetail> applyDetails;
	@OneToMany(fetch = FetchType.LAZY,mappedBy="apply")
	private Set<ApplyDeal> applyDeals;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public Double getMoney() {
		return money;
	}
	public void setMoney(Double money) {
		this.money = money;
	}
	public String getIsReturn() {
		return isReturn;
	}
	public void setIsReturn(String isReturn) {
		this.isReturn = isReturn;
	}
	public String getReturnFlag() {
		return returnFlag;
	}
	public void setReturnFlag(String returnFlag) {
		this.returnFlag = returnFlag;
	}
	public void setApplyDetails(Set<ApplyDetail> applyDetails) {
		this.applyDetails = applyDetails;
	}
	public Set<ApplyDetail> getApplyDetails() {
		return applyDetails;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	public String getLevel() {
		return level;
	}
	public void setApplyDeals(Set<ApplyDeal> applyDeals) {
		this.applyDeals = applyDeals;
	}
	public Set<ApplyDeal> getApplyDeals() {
		return applyDeals;
	}
}
